<div class="inner-form">
	<div class="box box-100">
		<div class="boxin">
			<div class="header">
				<h1>Users</h1>
				<a class="button altbutton" href="/backoffice/users/create">Add user</a>
			</div>
			
			<div class="content">
                <table width="100%">
                    <?php if (count($this->users)) { ?>
                    	<thead>
                            <tr>
                        		<th>Username</th>
                        		<th>Email</th>
                        		<th>Firstname</th>
                        		<th>Initials</th>
                        		<th>Surname</th>
                        		<th>Provider</th>
                        		<th>Groups</th>
                        		<td class="tc last">Actions</td>
                        	</tr>
                    	</thead>

						<tbody>
                            <?php foreach ($this->users as $user) { ?>
                                <tr>
                            		<td><?=$user->getUsername()?></td>
                            		<td><?=$user->getEmail()?></td>
                            		<td><?=$user->getFirstname()?></td>
                            		<td><?=$user->getInitials()?></td>
                            		<td><?=$user->getSurname()?></td>
                            		<td><?=$user->getProvider()->getName()?></td>
                            		<td>
                            			<?php foreach($user->getGroups() as $group) { ?>
                            				<?php echo $group->getName() ?>, 
                        				<?php }?>
                            		</td>
                            		<td class="tc last">
                            			<ul class="actions">
                            				<li><a class="ico" title="Edit" href="/backoffice/users/update/uid/<?=$user->getID()?>"><img alt="edit" src="/images/fff/pencil.png" /></a></li>
                            				<li><a class="ico" title="Delete" href="/backoffice/users/delete/uid/<?=$user->getID()?>"><img alt="edit" src="/images/fff/cross.png" /></a></li>
                        				</ul>
                    				</td>
                            	</tr>
                            <?php } ?>
                        </tbody>
                    <?php } ?>
                </table>
                <?php
                    echo $this->paginationControl($this->users,
                                                  'Sliding',
                                                  'partials/pagination.phtml');
                ?>
            </div>
        </div>
    </div>
</div>